home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir39 / borfix.zip / MEMORY.QA < prev    next >
Text File  |  1990-05-30  |  2KB  |  47 lines

  1.  
  2.  
  3. TITLE: TURBO PASCAL MEMORY ISSUES
  4. ===========================================================
  5.  
  6. TP 4.0 5.0 5.5 EXEC - SETTING HEAP MEMORY
  7. Q. How do I set the heap memory when executing a child process?
  8. A. Probably the best way to do this is through trial and error. 
  9.    Set the heap maximum to some large value, and run the program.
  10.    If it runs out of memory, then divide the maximum by 2, and so
  11.    on, until the parent and child programs have enough memory. 
  12.    The same can be done with the heap minimum.  Also, if you have
  13.    access to CompuServe, you can download a routine that swaps
  14.    the parent program between memory and disk.
  15.  
  16. TP 4.0 5.0 5.5 - ALLOCATING AND RECLAIMING MEMORY USING DOS 
  17. Q. What Dos functions can I use to reclaim memory to Dos? 
  18. A. You essentially must write your own GetMem and FreeMem
  19.    routines.  GetMem would make a call to Dos function $48 and
  20.    FreeMem would make a call to Dos function $49.  For more
  21.    details on these functions please consult an IBM PC
  22.    programmer's guide.
  23.  
  24. TP 4.0 5.0 5.5 - MEMORY CONTROL BLOCKS
  25. Q. How many memory control blocks does a Turbo Pascal program
  26.    use?
  27. A. Just one.
  28.  
  29.  
  30. TP 5.0 5.5 - EMS SUPPORT
  31. Q. Does Turbo Pascal 5.0+ support EMS?
  32. A. Yes. Turbo Pascal 5.0+ will use up to 64K (if selected in
  33.    TINST) of EMS for storing the edit buffer. In addition, you
  34.    can instruct the Overlay unit to place your overlaid units on
  35.    EMS. Finally, EMS.PAS on the distribution disk shows you how
  36.    to access EMS memory.
  37.  
  38.  
  39. TP 5.5 - HEAP SPACE STILL CREATED WITH HEAP MAX 0
  40. Q. Compiling to disk with my heap maximum set to 0 still creates
  41.    heap space when running .EXE file.  Why?
  42. A. This has to do with the way DOS allocates memory for .EXE
  43.    files in chunks of 512 bytes, rather than in chunks of 16
  44.    bytes. As a result of DOS's allocation, you always get 0-496
  45.    bytes more than you request.
  46.  
  47.